package com.qydp.consumer.example;

import cn.hutool.json.JSONUtil;
import com.qydp.common.model.User;
import com.qydp.common.service.UserService;
import com.qydp.rpc.proxy.ProxyUtils;

import java.util.Objects;

/**
 * @author shuSheng
 * @description
 * @since 2024-07-15 18:09
 */
public class ConsumerExample {
    public static void main(String[] args) {
        UserService userService = ProxyUtils.getProxy(UserService.class);
        User user = new User();
        user.setName("shuxiaosheng2");
        User user1 = userService.setUserName(user);
        System.out.println(JSONUtil.toJsonStr(user1));
        if (Objects.isNull(user1)) {

            System.out.println("user is null");
        } else {
            System.out.println("user is not null");
        }
    }

}

